<?php

/**
 * My Application bootstrap file.
 */
use Nette\Diagnostics\Debugger,
    Nette\Application\Routers\Route,
    Nette\Application\Routers\SimpleRouter,
    Doctrine\ORM\Configuration,
    Doctrine\ORM\EntityManager;

// Load Nette Framework
$params['libsDir'] = __DIR__ . '/../libs';
require $params['libsDir'] . '/Nette/loader.php';

// Enable Nette Debugger for error visualisation & logging
Debugger::$logDirectory = __DIR__ . '/../log';
Debugger::$strictMode = TRUE;
Debugger::enable();
//Debugger::enable(Debugger::DEVELOPMENT);

// Load configuration from config.neon file
$configurator = new Nette\Configurator;
$configurator->container->params += $params;
$configurator->container->params['tempDir'] = __DIR__ . '/../temp';
$configurator->container->params['modelsDir'] = __DIR__ . '/models';
$configurator->container->params['doctrineDir'] = __DIR__ . '/../libs/Doctrine';
$configurator->container->params['entitiesDir'] = __DIR__ . '/models/entities';
$configurator->container->params['proxyDir'] = __DIR__ . '/models/doctrine/proxy';
$container = $configurator->loadConfig(__DIR__ . '/config.neon');

/*
  // Setup router
  $router = $container->router;
  $router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
  $router[] = new Route('<presenter>/<action>[/<id>]', 'Admin:Sign:default');
 */
$container->router = new SimpleRouter('Admin:Sign:in');

// Configure and run the application!
$application = $container->application;
$application->catchExceptions = TRUE;
//$application->errorPresenter = 'Error';

$application->run();
